import java.util.Scanner;
public class test536 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter the first 9 digits of an ISBN as a string: ");
        String isbn = scanner.nextLine();
        if (isbn.length() != 9) {
            System.out.println(isbn + " is an invalid input");
            scanner.close();
            return;
        }
        int sum = 0;
        for (int i = 0; i < 9; i++) {
            int digit = isbn.charAt(i) - '0';
            sum += (i + 1) * digit;
        }
        int checksum = sum % 11;
        String fullISBN = isbn + (checksum == 10 ? "X" : checksum);
        System.out.println("The ISBN-10 number is " + fullISBN);
        scanner.close();
    }
}

